/*
 *  Copyright 2016 http://www.kedacomframework.org
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *
 */

package com.kedacom.ctsp.authz.oauth2.service;


import com.kedacom.ctsp.authority.entity.Department;
import com.kedacom.ctsp.authority.entity.Resource;
import com.kedacom.ctsp.authority.vo.ResourceVO;
import com.kedacom.ctsp.authz.oauth2.core.vo.*;
import com.kedacom.ctsp.web.controller.message.ResponseMessage;
import com.kedacom.ctsp.web.entity.page.PagerResult;
import com.kedacom.ctsp.web.entity.param.QueryParamEntity;

import java.util.List;

/**
 * TODO 完成注释
 *
 * @author fenghaiju
 */
public interface OAuthResourceService {
    /**
     * 根据client获取用户信息
     *
     * @param param
     * @return
     */
    PagerResult<PlainUser> queryUser(ClientQueryParam param);

    /**
     * 根据client获取部门信息
     *
     * @param param
     * @return
     */
    PagerResult<PlainDepartment> queryDepartment(ClientQueryParam param);

    /**
     * 根据client获取人员信息
     *
     * @param param
     * @return
     */
    PagerResult<PlainPerson> queryPerson(ClientQueryParam param);


    /**
     * 根据client获取角色信息
     *
     * @param param
     * @return
     */
    PagerResult<PlainRole> queryRole(ClientQueryParam param);


    /**
     * 根据client获取角色信息
     *
     * @param param
     * @return
     */
    PagerResult<PlainRole> queryRoleByUser(UserQueryParam param);


    /**
     * @param param
     * @return
     */
    PagerResult<PlainResourceSetting> queryResourceSetting(ClientQueryParam param);


    String updatePassword(String userId, String oldPassword, String newPassword);

    /**
     * 按条件获取当前登录用户拥有的树形资源
     *
     * @param param
     * @return
     */

    ResponseMessage<List<ResourceVO>> listMyAsTree(ClientQueryParam param);


    /**
     * 获取客户端列表
     *
     * @param param
     * @return
     */
    ResponseMessage<PagerResult<PlainClient>> clientList(QueryParamEntity param);

    /**
     * 通过用户获取绑定的项目
     *
     * @param param
     * @return
     */
    List<PlainClient> getUserClient(UserQueryParam param);


    /**
     * 获取部门列表
     *
     * @param pid
     * @param param
     * @return
     */
    PagerResult<Department> queryDept(String pid, ClientQueryParam param);

    /**
     * 通过指定用户获取部门列表
     *
     * @param pid
     * @param param
     * @return
     */
    PagerResult<Department> queryDeptByUser(String pid, UserQueryParam param);


    /**
     * 获取部门树
     *
     * @param pid
     * @param param
     * @return
     */
    List<Department> queryDeptAsTree(String pid, ClientQueryParam param);

    /**
     * 通过指定用户获取部门树
     *
     * @param pid
     * @param param
     * @return
     */
    List<Department> queryDeptAsTreeByUser(String pid, UserQueryParam param);


    /**
     * 获取资源信息
     *
     * @param pid
     * @param param
     * @return
     */
    PagerResult<Resource> queryResource(String pid, ClientQueryParam param);

    /**
     * 通过用户获取资源信息
     *
     * @param pid
     * @param param
     * @return
     */
    PagerResult<Resource> queryResourceByUser(String pid, UserQueryParam param);


    /**
     * 获取部门树
     *
     * @param pid
     * @param param
     * @return
     */
    List<Resource> queryResourceAsTree(String pid, ClientQueryParam param);

    /**
     * 通过指定用户获取部门树
     *
     * @param pid
     * @param param
     * @return
     */
    List<Resource> queryResourceAsTreeByUser(String pid, UserQueryParam param);
}
